//
//  PublishView.m
//  Find
//
//  Created by lanou3g on 15/10/28.
//  Copyright © 2015年 Reiko. All rights reserved.
//

#import "PublishView.h"
#import "PublishViewController.h"
#define kSubViewLong 60
@implementation PublishView

+ (PublishView *)sharePublishView
{
    
    static PublishView *view = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        view = [[PublishView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    });
    return  view;
    
}
- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        self.alpha = 0.99;
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    // 遗失东西的按钮
   self.writeLostButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.writeLostButton.frame = CGRectMake(80, kScreenHeight / 3, kSubViewLong, kSubViewLong);
    [self.writeLostButton setBackgroundImage:[UIImage imageNamed:@"tabbar_compose_transfer.png"] forState:UIControlStateNormal];
    [self addSubview:self.writeLostButton];
    // 遗失东西的label
    UILabel *writeLostLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.writeLostButton.left - 5, self.writeLostButton.bottom + 5, 100, 20)];
    writeLostLabel.text = @"遗失东西";
    [self addSubview:writeLostLabel];
    
    // 捡到东西的按钮
    self.writeFindButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.writeFindButton.frame = CGRectMake(self.writeLostButton.right + 80, self.writeLostButton.top, kSubViewLong, kSubViewLong);
    [self.writeFindButton setBackgroundImage:[UIImage imageNamed:@"tabbar_compose.png"] forState:UIControlStateNormal];
    [self addSubview:self.writeFindButton];
    
    // 捡到东西的label
    UILabel *writeFindLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.writeFindButton.left - 5, self.writeFindButton.bottom + 5, 100, 20)];
    writeFindLabel.text = @"捡到东西";
    [self addSubview:writeFindLabel];
    
    // 地下的toolbar
    UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, kScreenHeight - 49, kScreenWidth, 49)];
    toolbar.backgroundColor = [UIColor colorWithWhite:0.965 alpha:1.000];
    [self addSubview:toolbar];
    // 取消按钮
    self.cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.cancelButton.frame = CGRectMake(kScreenWidth/2 - 15, 5, 30, 30);
    [self.cancelButton setBackgroundImage:[UIImage imageNamed:@"cha.png"] forState:UIControlStateNormal];
    [toolbar addSubview:self.cancelButton];
}


@end
